package com.py.minio;

import com.py.file.service.FileStorageService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.FileInputStream;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2022/11/8 14:47
 * @Version 1.0
 */
@SpringBootTest(classes = MinioApplication.class)
@RunWith(SpringRunner.class)
@Slf4j
public class MinioTest2 {

    @Autowired
    FileStorageService fileStorageService;

    @Test
    public void upload() throws Exception{

        FileInputStream inputStream = new FileInputStream("D://list.html");
        String url = fileStorageService.uploadHtmlFile("", "list.html", inputStream);
        log.info(url);
    }
}